﻿<%@ Page Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="Admin_QLHoaDon.aspx.cs" Inherits="ppm_BaByShop.WebForm23" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        QUẢN LÝ HÓA ĐƠN</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ppm_BaByShopConnectionString1 %>" 
            DeleteCommand="DELETE FROM [HOA_DON] WHERE [ma_hoa_don] = @original_ma_hoa_don AND [ma_kh] = @original_ma_kh AND [ma_tt_hoa_don] = @original_ma_tt_hoa_don" 
            InsertCommand="INSERT INTO [HOA_DON] ([ma_hoa_don], [ma_kh], [ma_tt_hoa_don]) VALUES (@ma_hoa_don, @ma_kh, @ma_tt_hoa_don)" 
            SelectCommand="SELECT * FROM [HOA_DON]" 
            
            UpdateCommand="UPDATE [HOA_DON] SET [ma_kh] = @ma_kh, [ma_tt_hoa_don] = @ma_tt_hoa_don, [ngay_mua] = @ngay_mua WHERE [ma_hoa_don] = @original_ma_hoa_don AND [ma_kh] = @original_ma_kh AND [ma_tt_hoa_don] = @original_ma_tt_hoa_don" 
            ConflictDetection="CompareAllValues" 
            OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_ma_hoa_don" Type="String" />
                <asp:Parameter Name="original_ma_kh" Type="Int32" />
                <asp:Parameter Name="original_ma_tt_hoa_don" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ma_kh" Type="Int32" />
                <asp:Parameter Name="ma_tt_hoa_don" Type="Int32" />
                <asp:Parameter Name="ngay_mua" Type="Object" />
                <asp:Parameter Name="original_ma_hoa_don" Type="String" />
                <asp:Parameter Name="original_ma_kh" Type="Int32" />
                <asp:Parameter Name="original_ma_tt_hoa_don" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ma_hoa_don" Type="String" />
                <asp:Parameter Name="ma_kh" Type="Int32" />
                <asp:Parameter Name="ma_tt_hoa_don" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="ma_hoa_don" 
            DataSourceID="SqlDataSource1" Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="ma_hoa_don" HeaderText="ma_hoa_don" ReadOnly="True" 
                    SortExpression="ma_hoa_don" />
                <asp:BoundField DataField="ma_kh" HeaderText="ma_kh" SortExpression="ma_kh" />
                <asp:BoundField DataField="ma_tt_hoa_don" HeaderText="ma_tt_hoa_don" 
                    SortExpression="ma_tt_hoa_don" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
    </p>
</asp:Content>
